package com.ct.boss.demo.controller;

import com.ct.boss.demo.annotation.PassToken;
import com.ct.boss.demo.http.HttpResult;
import com.ct.boss.demo.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ChenTong
 * @version 1.0
 * @description 多级菜单逻辑控制器
 * @date 2020/6/16 21:59
 * @modified
 **/
@RestController
public class MenuController {
    @Autowired
    MenuService menuService;

    /**
     * @description 获取侧边栏才当
     * @author ChenTong
     * @return com.ct.boss.demo.http.HttpResult 返回多级菜单的嵌套json数组结构
     * @date 2020/6/17 12:05
     */
    @PassToken
    @GetMapping("/menus")
    public HttpResult getMenu(){
        return HttpResult.ok(menuService.getMenus());
    }

}
